<meta http-equiv="content-type" content="text/html;charset=utf-8">
<?php 
include("config.php");

//modify by kakaryan @ 2006-11-27
//if(getenv('HTTP_CLIENT_IP')) { 
//$onlineip = getenv('HTTP_CLIENT_IP');
//} elseif(getenv('HTTP_X_FORWARDED_FOR')) { 
//$onlineip = getenv('HTTP_X_FORWARDED_FOR');
//} elseif(getenv('REMOTE_ADDR')) { 
//$onlineip = getenv('REMOTE_ADDR');
//} else { 
//$onlineip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
//}

if($_POST["addurl"]&&$_POST["address"]&&$_POST["user"]) 
{
	$address=$_POST["address"];
	$usr=$_POST["user"];
	$tag=$_POST["tag"];
	$email=$_POST["email"];
	$ip=$_POST["ip"];
	$time=date("Y-m-d H:i:s");
	$pass="yes";
	$sql="insert into $usertable(address,user,tag,email,ip,pass,time) values('$address','$user','$tag','$email','$ip','$pass','$time') ";
	if($db->execute($sql)) 
	{
		echo ("<script type='text/javascript'> alert('添加成功');location.href='add.php';</script>");
	}
	else
	{
		echo ("<script type='text/javascript'> alert('添加失败');location.href='add.php';</script>");
	}
	
}
else
{
		echo ("<script type='text/javascript'> alert('添加失败11');location.href='add.php';</script>");
}

?>
